<?php


	namespace app\home\validate;


	class CartValidate extends Base
	{


		protected $rule = [
			['goods_id', 'require|isInteger', '商品不能为空|商品参数有误'],
			['total', 'require|isInteger', '数量不能为空|数量必须未正整数'],
			['cart_id', 'require|isInteger', '购物车id不能为空|购物车id必须未正整数'],
			['seleted', 'require|isInteger', '选中状态不能为空|选中状态必须未正整数'],
			['cart_id', 'require|isInteger', '购物车id不能为空|购物车id必须为正整数'],
			['type', 'require', '修改方式必须存在'],
		];

		protected $scene = [
			'add'             => ['goods_id', 'total'],
			'selected'        => ['cart_id', 'seleted'],
			'updateCartStock' => ['cart_id', 'type'],
			'delCart'         => ['cart_id']
		];


	}